package org.springblade.common.utils.delayed;

import com.alibaba.fastjson.JSONObject;
import com.github.thierrysquirrel.annotation.CommonMessage;
import com.github.thierrysquirrel.annotation.RocketMessage;
import com.github.thierrysquirrel.annotation.StartDeliverTime;
import com.github.thierrysquirrel.core.producer.MessageSendType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @Date 8:54 2024/9/10
 * @Description {
 *   电梯停梯
 * }
 * @Author lsay
 **/
@Slf4j
@Component
@RocketMessage(groupID = "GID_STOP_ELEVATOR")
public class BuildingPlanWeeklyReportSend {

	@CommonMessage(topic = "stop_elevator", tag = "elevator_stop_test",messageSendType = MessageSendType.SEND_ASYNC)
	public String sendElevatorStopTestMsg(@StartDeliverTime long startDeliverTime,String message) {
		log.info("===============实时生产消息====================", System.currentTimeMillis());
		JSONObject jsonObject = JSONObject.parseObject(message);
		jsonObject.put("sendMsgType","elevator_stop_test");
		log.info("发送时间:[{}],发送内容:[电梯停梯消息:{}]", LocalDateTime.now(), JSONObject.toJSONString(jsonObject));
		return message;
	}

	@CommonMessage(topic = "stop_elevator", tag = "elevator_stop",messageSendType = MessageSendType.SEND_ASYNC)
	public String sendElevatorStopMsg(@StartDeliverTime long startDeliverTime,String message) {
		log.info("===============实时生产消息====================", System.currentTimeMillis());
		JSONObject jsonObject = JSONObject.parseObject(message);
		jsonObject.put("sendMsgType","elevator_stop");
		log.info("发送时间:[{}],发送内容:[电梯停梯消息:{}]", LocalDateTime.now(), JSONObject.toJSONString(jsonObject));
		return message;
	}

}
